@extends('admin.layouts.app')

@section('right-content')

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>新增渠道商</legend>
    </fieldset>

    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">账号</label>
            <div class="layui-input-block">
                <input type="text" name="account" lay-verify="required" autocomplete="off" placeholder="请输入账号" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">渠道名称</label>
            <div class="layui-input-block">
                <input type="text" name="realname" lay-verify="required" autocomplete="off" placeholder="请输入渠道名称" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">手机号码</label>
            <div class="layui-input-block">
                <input type="text" name="phone" lay-verify="" autocomplete="off" placeholder="请输入手机号码" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input type="text" name="email" lay-verify="" autocomplete="off" placeholder="请输入邮箱地址" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">渠道编号</label>
            <div class="layui-input-block">
                <input type="text" name="distributer_id" lay-verify="required|number" autocomplete="off" placeholder="请输入角色名称" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="desc"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="1" title="启用" checked>
                <input type="radio" name="status" value="0" title="停用">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="sub" data-url="{{ route('channels.store') }}">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
@endsection

@section('my-js')
<script type="text/javascript">
   layui.use('form', function(){
       var form = layui.form;

      form.on('submit(sub)', function(data){
        var url = $(this).attr('data-url');
        commonAjaxSubmit(url, 'POST');

      })
    });
</script>
@endsection

